package server.controller;

import com.thoughtworks.xstream.annotations.XStreamAlias;

import common.Settings;

/**
 * Updates the settings of the server
 */
@XStreamAlias("ServerSettings")
public class ServerSettings implements Settings {
	@XStreamAlias("ConnectionPort")
	private int connectionPort;
	
	@XStreamAlias("MaxNumberOfConnections")
	private int maxNumberOfConnections;
	
	@XStreamAlias("SocketTimeout")
	private int socketTimeout;
	
	@XStreamAlias("SolverDepth")
	private int solverDepth;
	
	/**
	 * Default CTOR
	 */
	public ServerSettings() {
	}
	
	/**
	 * CTOR
	 * @param connectionPort the port of the server
	 * @param maxNumberOfConnections maximum allowed connections
	 * @param socketTimeout socket's timeout
	 * @param solverDepth the wanted depth for solution of current game
	 */
	public ServerSettings(int connectionPort, int maxNumberOfConnections, int socketTimeout, int solverDepth) {
		this.connectionPort = connectionPort;
		this.maxNumberOfConnections = maxNumberOfConnections;
		this.socketTimeout = socketTimeout;
		this.solverDepth = solverDepth;
	}
	
	@Override
	public String getClassAlias() {
		return "ServerSettings";
	}
	
	public int getConnectionPort() {
		return connectionPort;
	}
	
	public int getMaxNumberOfConnections() {
		return maxNumberOfConnections;
	}
	
	public int getSocketTimeout() {
		return socketTimeout;
	}
	
	public int getSolverDepth() {
		return solverDepth;
	}
}
